home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / chinesetex.lha / readme < prev   
Encoding:
Text File  |  1995-01-27  |  13.1 KB  |  334 lines

  1. CJK - Chinese/Japanese/Korean languages for TeX (LaTeX 2e).
  2.  
  3. Original CJK package by Werner Lemberg.
  4. Original pbmtopk by AJCD and Tomas Rokicki.
  5.  
  6. Adapted for Amiga usage by David Fong 23-Dec-94 to 20-Jan-95.
  7.  
  8. What is in this readme file
  9.  
  10. 1. Includes - What does this package have?
  11. 2. Contents - What is in each of this package's directories.
  12. 3. Purpose, and how to use this package.
  13.             - Including setting up and finding fonts and 
  14.               how to edit `Chinese' text.
  15. 4. Update notes
  16. 5. Parting words
  17.  
  18. Appendices (in a separate file, named `appendix')
  19.  
  20.  A. Where can I find CJK?
  21.  B. Where is the Aminet?
  22.  C. Where can I find Chinese software?
  23.  D. What Chinese software is available for the Amiga?
  24.     In particular, text editors and text viewers?
  25.  E. Where are the Chinese fonts?
  26.  F. How do I install CJK?
  27.  
  28. 1. Includes -
  29.  
  30.    Compiled programs from the CJK package and other necessary
  31.    binaries...
  32.  
  33.    hbf2hbf
  34.    Modified version of hbf2cjk
  35.    `Corrected' and modified version of pbmtopk (from netpbm package).
  36.  
  37.    all compiled by GNU GCC 2.6.3.
  38.    
  39.    I have not included the major portion of the CJK package.  CJK
  40.    can be obtained from CTAN sites (see Appendix A).
  41.    
  42.    Oh dear, any programs I compiled with GCC requires the
  43.    ixemul.library. Unfortunately, anything I compiled with
  44.    `-noixemul' didn't work. More specifically, my Amiga crashed
  45.    when `hbf2cjk' was run (having generated quite a few dozen
  46.    font files, but not all of ones required). Please tell me what
  47.    could be wrong...
  48.  
  49. 2. Contents -
  50.  
  51.    cjk - bin - binaries of `hbf2hbf' and `hbf2cjk'
  52.        - src - modified sources of the same.
  53.     
  54.    netpbm - bin - binary of `pbmtopk'
  55.                   plus other programs from the netpbm
  56.                   package that are required by `hbf2cjk'
  57.        
  58.           - src - modified sources of `pbmtopk'.
  59.  
  60. 3. Purpose and usage.
  61.    
  62.    a. Purpose
  63.    
  64.    As of yet, the Amiga does not have a Chinese language word-
  65.    processor.  However, the TeX package, which is available in at
  66.    least three different guises for the Amiga (AmigaTeX by
  67.    Radical Eye Software, PasTeX and also generic TeX), can be
  68.    extended to handle Chinese.
  69.    
  70.      One such package is `CJK', written by Werner Lemberg.  It is
  71.    available at CTAN sites (see Appendix A if you don't know what
  72.    CTAN is).  CJK in turn requires LaTeX 2e (also available at
  73.    CTAN sites!), which in turn requires a version of TeX to run.
  74.    Personally, I use PasTeX 1.3 (available at CTAN sites, but
  75.    also at Aminet sites and Fred Fish CD-ROM), and also the beta
  76.    6 version of PasTeX (available on the Aminet).  Note that
  77.    PasTeX 1.3 comes with LaTeX 2.03, which needs to be updated to
  78.    LaTeX 2e if you want to use CJK.
  79.       
  80.      * What is the Aminet?  See Appendix B.
  81.    
  82.      And what did I need to `correct' with pbmtopk?  Well,
  83.    neither the pbmtopk provided with the netpbm distribution, nor
  84.    that provided with PasTeX actually work.  Recompiling the
  85.    source provided with netpbm with GCC 2.6.0 didn't work either.
  86.    For some reason, the pbmtopk provided rejects perfectly valid
  87.    `opt' file lines.  This is a bug with GCC, I think.  I
  88.    replaced....
  89.    
  90.      if (sscanf(here,"%s%n",str,&n) != 1)
  91.  
  92.      with...
  93.      
  94.      a=sscanf(here,"%s%n",str,&n);
  95.      if (a != 1)
  96.      
  97.  
  98.    b. Usage - setting up.
  99.    
  100.      Sorry, I was unable to compile the programs successfully
  101.    without resorting to `ixemul.library'.  I'm afraid you'll have
  102.    to obtain a copy of `ixemul.library'.  One source is the `dev/
  103.    gcc' directory in Aminet archives.  I tried to use `libnix',
  104.    but it failed.  Please tell me if I was using libnix
  105.    incorrectly.  I was calling gcc with...
  106.    
  107.      gcc -noixemul source.c gnu:lib/libnixmain.a -lm -o object
  108.      
  109.      All the programs I compiled required command line arguments.
  110.    Some of the programs seemed to work, but after running for a
  111.    while would eventually crash.  (In particular, hbf2cjk would
  112.    successfully create a few pk files, before crashing.
  113.    `pbmtopk', which is called multiple times by hbf2cjk, may have
  114.    been responsible?)
  115.  
  116.      Setting up PasTeX, or any public domain version of TeX, is a
  117.    complete story in itself.  You might be able to avoid some of
  118.    the hassle by setting up `AmigaTeX' by Radical Eye Software.
  119.    Be warned, however, that it costs quite a lot more than most
  120.    Amiga desktop-publishers, but probably a lot less than a
  121.    legitimate copy of Chinese WordStar (but all those IBM clone
  122.    users are worse pirates than Amiga owners...).
  123.    
  124.      By the way, PasTeX provides its own copy of `pbmtopk'.  Just
  125.    like the one provided in the netpbm distribution, it doesn't
  126.    work.  PasTeX's copy is in tex:bin.  If you have set up
  127.    PasTeX, tex:bin will be in the standard search path.  So it
  128.    would be better if you delete PasTeX's copy of pbmtopk, to
  129.    prevent it being called from `hbf2cjk'.
  130.    
  131.    b1. Usage - setting up the fonts.
  132.    
  133.      Japanese and Korean users are relatively lucky, outline
  134.    fonts are available for their character sets.  I haven't tried
  135.    to use them, so they might have problems in setting up `CJK'
  136.    that I don't know about.  The big problem for Chinese language
  137.    users is that outline fonts are not generally available.  In
  138.    any case, CJK provides a set of programs to convert `Hanzi
  139.    bitmap fonts' to a format usable by CJK and LaTeX 2e.
  140.    
  141.      Werner Lemberg was kind enough to provide the C source for
  142.    those utilities.  Anyone with enough perseverance and computer
  143.    know-how to set up PasTeX could probably compile the C source
  144.    code by themselves.  However, to save those people time (like
  145.    about 12 hours), I have compiled `hbf2hbf' and `hbf2cjk' with
  146.    GNU C 2.6.3.
  147.    
  148.      hbf2hbf creates an `.hbf' file.  Included in this file is a
  149.    line which defines where the `.bmf' file is to be found.  For
  150.    example...
  151.      
  152.         HBF_CODE_RANGE 0x0100-0x20F2 ram:jsfs10.bmf 0
  153.          
  154.      Of course, if you decide to place your `.bmf' file
  155.    elsewhere, you might want to change this line.  For my
  156.    purposes, I changed `ram:jsfs10.bmf' to `jsfs10.bmf', and ran
  157.    `hbf2cjk' from the directory where jsfs10.hbf and jsfs10.bmf
  158.    resided.
  159.    
  160.      `hbf2cjk' uses the package `netpbm', which is available on
  161.    the Aminet.  (See Appendix B if you don't know what the Aminet
  162.    is).  Unfortunately, as far as I can tell, `pbmtopk', as
  163.    provided on `netpbm', does not work.  So I had to recompile
  164.    its source code (the source code is also available on the
  165.    Aminet!).  For convenience, I also included the other netpbm
  166.    files required by hbf2cjk.
  167.    
  168.    b2. Usage - Running the programs.
  169.  
  170.      I've changed hbf2cjk  to  allow  different  point  sizes  and
  171.    independent x  and  y  resolutions.  Obviously,  the  original
  172.    programmer  assumed  that  everyone has 300x300 dpi or 600x600
  173.    dpi laser printers! As a result of my changes,  the  arguments
  174.    to hbf2cjk have changed...
  175.  
  176.    hbf2cjk HBF_file fontname x-resolution y-resolution size family encoding
  177.  
  178.    To create a 100 dpi jsfs font at 14.4 point size (e.g. ShowDVI)...
  179.    
  180.    hbf2cjk jsfs10.hbf jsfs10 100 100 14.4 "Jianti FangSong" GB
  181.    
  182.    To create a twelve point font at 600x300 dpi (e.g. HP 520)...
  183.    
  184.    hbf2cjk jsfs10.hbf jsfs10 600 300 12 "Jianti FangSong" GB
  185.  
  186.    b3. Usage - finding the fonts.
  187.    
  188.      Of course, you will need to find bitmap fonts to convert to
  189.    LaTeX format.  They range from 16 pixels wide, to at least 56
  190.    pixels wide.  These will be appropriately scaled by hbf2cjk.
  191.    If you are lucky enough to have a 600x600 dpi printer, some
  192.    `ready-made' LaTeX fonts are available on the Internet
  193.    (reportedly, I haven't actually found them at a CTAN site).
  194.    See Appendix E.
  195.  
  196.    b4. Usage - editing `Chinese' text.
  197.    
  198.      The other problem you will have to resolve is a Chinese text
  199.    editor.  CJK will accept `GuoBiao' encoding.  It also
  200.    accepts other encodings such as `Big5' and `KS'.  In GuoBiao
  201.    encoding each Chinese character is encoded as two bytes, using
  202.    the upper range of the ASCII character set (a range of values
  203.    above 128).
  204.    
  205.      Apparently, there are a number of DOS programs which allow
  206.    you to write GuoBiao encoded text, such as Z-DOS.  And you
  207.    could use Windows/Mac Chinese editors to create GuoBiao
  208.    encoded text.  But you want to do everything on the Amiga,
  209.    right?
  210.    
  211.      Well, also available at CTAN archives is CHText.  This
  212.    converts Pinyin to GuoBiao (and back again).  Source code is
  213.    provided (as is a 16 pixel Chinese bitmap font), but I met
  214.    only moderate success in compiling this monster.  Curtis
  215.    Eubanks did a much better job, see Appendix D.
  216.    
  217.      What does ChText do exactly.  You type in Pinyin ASCII with
  218.    your favourite text editor (just like a TeX document).  For
  219.    example `Ni3 hao3'.  Tone marks are optional, but speed up the
  220.    conversion process.  Some `compound characters' are provided,
  221.    like `ming2-tian1', to again speed up the conversion process.
  222.    Whatever needs to be converted to GuoBiao is encapsulated in
  223.    `\Zw' and `\As', just like a TeX environment is enclosed in
  224.    something like `\begin{document}' and `\end{document}'.
  225.    However, the ChTexT will remove `\Zw' and `\As' when the file
  226.    is processed.  If the Pinyin could represent one of several
  227.    characters (a common occurrence), ChText presents a range of
  228.    characters to choose from.  Of course, the number of
  229.    characters is reduced if tone marks and recognized compound
  230.    characters are used.
  231.    
  232.      ChTexT can also convert GuoBiao back to Pinyin, but with
  233.    extra identifiers.  These extra identifiers remove the need to
  234.    `choose' that character again when the file is converted to
  235.    GuoBiao again.  `Ni3' may have been converted to `Ni3xl (I
  236.    made that up, but that is what it looks like)'.  The Pinyin is
  237.    still entirely recognizable.
  238.    
  239. 4. Update notes
  240.  
  241.    I thought I managed to compile this thing successfully with the
  242.    `-noixemul' option, but alas, it was not meant to be...
  243.    
  244.    8-Jan-95
  245.    
  246.    The original hbf2cjk only allowed a short fontname, to suit
  247.    those silly MS-DOS/Windows machines, I think.  I have extended
  248.    the file-name length quite a lot, allowing one to specify a
  249.    destination directory as well
  250.    
  251.    e.g. `ram:jsfs10'
  252.    
  253.    16-Jan-95
  254.    
  255.    I have changed the source of `hbf2cjk', so that the arguments
  256.    are now different...
  257.    
  258.    Previously, `hbf2cjk' assumed all created characters were ten
  259.    points in size, and so `#define DSIZE 10'.  Inter-character
  260.    spacing was calculated accordingly.  That's just not
  261.    acceptable!  And so I introduced new code so that the
  262.    resolution and point size are separately defined...
  263.    
  264.    hbf2cjk HBF_file fontname resolution size family encoding
  265.    
  266.    To do...
  267.    
  268.    I've had to return the 24-pin 360x360 Fujitsu printer I
  269.    borrowed from some-one else.  Now I have my 240x216 MPS 1000
  270.    (Epson OX).  If I buy a new printer, it wil probably be a
  271.    600x300 HP 540.  But neither `hbf2cjk' or `pbmtopk' currently
  272.    support fonts which have different `x' and `y' resolutions.
  273.    This will obviously be my next target...but if there is source
  274.    code to a `pbmtopk' which supports different `x' and `y'
  275.    resolutions out there, please send it to me (or tell me where
  276.    it is on the Internet)!
  277.  
  278.    20-Jan-95
  279.  
  280.    OK, on this windy afternoon after work I've re-written and
  281.    successfully re-compiled pbmtopk and hbf2cjk to accept
  282.    separate x and y resolutions. However, I haven't tested these
  283.    programs yet, I'm procrastinating over whether I'll buy that
  284.    Hewlett Packard 540 or not. I'll probably hook up my MPS 1000
  285.    over the next few days...
  286.  
  287.    Now the arguments required are...
  288.  
  289.    hbf2cjk HBF_file fontname x-resolution y-resolution size family encoding
  290.  
  291.    26-Jan-95
  292.    
  293.    The separate x and y resolutions arguments do work!
  294.    Unfortunately, CJK has moved to version 2.4, the newest
  295.    version doesn't even have the program `hbf2cjk'.  It does have
  296.    the program `hbf2gf', which does not require the netpbm
  297.    library, but does require the programs `gftopk (provided with
  298.    PasTeX)' and `pltotf (not provided with PasTeX, but is
  299.    available as Pascal (WEB) source)'.  Unfortunately, I don't
  300.    have a Pascal compiler ready-to-run on my system, so it looks
  301.    as if I have some work to do.  The good news is that hbf2gf is
  302.    supposed to be ten or so times faster than hbf2cjk...
  303.       
  304. 5. Finally
  305.  
  306.    I only got the whole thing working yesterday.  It took a lot
  307.    of sweat and tears, particularly for someone who doesn't
  308.    actually know much Chinese (I learnt it as a foreign language
  309.    during my high school).  Please excuse me if the bugs are
  310.    appalling, or some of the information is incorrect or vague.
  311.    My full-time job is not programming!  Nevertheless, I more
  312.    than welcome bug reports and correspondence.  Although I
  313.    didn't write anything, perhaps there is (yet another) compiler
  314.    option I should have switched on...
  315.    
  316.      I have released this package in the hope that anyone else
  317.    who intends to use Chinese on their Amiga will find it easier
  318.    to do so.  However, I am well aware that people who can use
  319.    TeX, and who can then also use strange programs from Unix
  320.    world are a special and unusual breed!
  321.    
  322.    Zai4 jian4!
  323.    
  324.    7-Jan-95.
  325.    
  326. David Fong
  327. vkelim@ariel.unimelb.edu.au (as of 1994)
  328. firehand@ariel.unimelb.edu.au (brother's account)
  329.  
  330. 13 Silverdale Road,
  331. Ivanhoe, 3079.
  332. Australia.
  333.  
  334.